﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;
using RESTServices.Dominio;
using RESTServices.Persistencia;

namespace RESTServices
{
    public class Reservas : IReservas
    {
        private ReservaDAO dao = new ReservaDAO();

        public Reserva CrearReserva(Reserva reservaCrear)
        {
            return dao.Crear(reservaCrear);
        }

        public Reserva ObtenerReserva(string idreserva)
        {
            return dao.Obtener(int.Parse(idreserva));
        }

        public Reserva ModificarReserva(Reserva reservaModificar)
        {
            return dao.Modificar(reservaModificar);
        }

        public void EliminarReserva(string idreserva)
        {
            dao.Eliminar(ObtenerReserva(idreserva));
        }

        public List<Reserva> ListarReservas()
        {
            return dao.ListarTodos().ToList();
        }
    }
}
